home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
PET
/
S-Super PET
/
(s)tz.d64
/
MAIN.ASM
< prev
next >
Wrap
Assembly Source File
|
2009-01-18
|
3KB
|
128 lines
opt nolist ;MAIN part of TABLE program
xref display,read_it,display,get_a_char,move_up,change_it
xref identification,input,write_it,set_parameters
xref filename, sample,answer,io_error
xref copystr_,prefixst_
main clrb
ldx #title
jsr get_a_char
one ldb #'4 ;maximum
ldx #source ;data from disk or to be input?
jsr get_a_char
cmpb #'1
if eq ;load sample file
loop ;'0' possible, no filtering available
clrb
ldx #which_drive
jsr get_a_char ;answer stays in ANSWER
cmpb #'1
quif eq
cmpb #'0
until eq
ldd #filename
pshs d
ldd #sample
jsr copystr_
leas 2,s
ldb answer
cmpb #'1 ;drive 1 ?
if eq ;if so, add 'disk/1.' prefix
ldd #filename
pshs d
ldd #drive_prefix
jsr prefixst_
leas 2,s
endif
jsr read_it
tst io_error
bne one ;redo if IO error
bra next
endif
cmpb #'2
if eq ;load another file already on disk
jsr identification
jsr read_it
tst io_error
bne one
bra next
endif
cmpb #'3
if eq ;new table to be input
jsr input
else
bra quit ;quit
endif
next jsr display
two ldb #'5
ldx #menu
jsr get_a_char
ldb #6
jsr move_up
ldb answer
cmpb #'1
if eq ;change one entry
jsr change_it
bra next
endif
cmpb #'2
if eq ;change format parameters
jsr set_parameters
bra next
endif
cmpb #'3
if eq ;write data to disk
jsr identification
jsr write_it
ldb #1
jsr move_up
bra two
endif
cmpb #'4
lbeq one ;another table
quit jsr $d9a9 ;clear screen
clr $32 ;quit
rts
title fcb 12,10,10,10,10,9,9
fcc "TABLE: a demo program on tables of FP numbers"
fcb 13,10,9,9
fcc " by Alain Proulx, for ISPUG"
fcb 13,10,9,9
fcc " Press any key "
fcb 0
source fcb 12,9
fcc "Do you wish to"
fcb 13,9,9
fcc "[1] see sample table?"
fcb 13,9,9
fcc "[2] see a table you previously saved on disk?"
fcb 13,9,9
fcc "[3] make a new table?"
fcb 13,9,9
fcc "[4] quit? "
fcb 0
which_drive fcc "Drive [1] or [0] ? "
fcb 0
drive_prefix fcc "disk/1."
fcb 0
menu fcb 13
fcc "Do you wish to"
fcb 13,9,9
fcc "[1] change one entry?"
fcb 13,9,9
fcc "[2] change format parameters?"
fcb 13,9,9
fcc "[3] put this table on disk?"
fcb 13,9,9
fcc "[4] move to another table?"
fcb 13,9,9
fcc "[5] quit? "
fcb 0
end